package com.dd.common.utils;

import org.aspectj.lang.JoinPoint;

import java.lang.reflect.Method;

/**
 * AOP工具类
 */
public class AopUtils {
    public static Method getCurrentMethod(JoinPoint joinPoint) {
        Method[] methods = joinPoint.getTarget().getClass().getMethods();
        Method target = null;
        for (Method method : methods) {
            if (method.getName().equals(joinPoint.getSignature().getName())) {
                target = method;
                break;
            }
        }
        return target;
    }
}
